package medium;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Elevator_1008 {
	public static void main(String[] args) throws IOException {
		BufferedReader reader=new BufferedReader(new InputStreamReader(System.in));
		String []line=reader.readLine().split(" ");
		int pre=0,res=0,num=Integer.valueOf(line[0]);
		for(int i=1;i<=num;++i) {
			int now=Integer.valueOf(line[i]);
			if(now>pre) {
				res+=(now-pre)*6;
			}
			else {
				res+=(pre-now)*4;
			}
			pre=now;
		}
		res+=5*num;
		System.out.println(res);
	}
}
